import { defineStore } from 'pinia'
import { useRoute } from 'vue-router'
import { computed } from 'vue'

export const useRouteStore = defineStore('routestore', () => {
  const route = useRoute()

  // 判断是否为docs页面（需要显示侧边栏和目录）
  const showSidebar = computed(() => {
    return route.path === '/docs' || route.path.startsWith('/docs/')
  })

  // 判断是否为特殊页面（全宽居中布局）
  const isSpecialPage = computed(() => {
    // 这里可以添加所有需要全宽居中布局的页面路径
    const specialPages = ['/', '/about/']
    return specialPages.includes(route.path)
  })

  return {
    showSidebar,
    isSpecialPage,
  }
})
